<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div style="padding: 2px 2px 2px 50px;">
	<form class="op-form" id="queryForm" name="queryForm" method="post">
		<table>
			<tr>
				<td>姓名:</td>
				<td>
					<input class="easyui-validatebox" name="name">
				</td>
			</tr>
			<tr>
				<td>所属部门:</td>
				<td>
					<select id="departid" name="departid" class="easyui-combobox" style="width: 206px;"></select>
				</td>
			</tr>
			<tr>
				<td>性别:</td>
				<td>
					<select id="sex" name="sex">
						<option value="0">女</option>
						<option value="1">男</option>
						<option value="3" selected="selected">全部</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>账户:</td>
				<td>
					<input class="easyui-validatebox" name="code">
				</td>
			</tr>
			<tr>
				<td>联系电话:</td>
				<td>
					<input class="easyui-validatebox" name="phone">
				</td>
			</tr>
			<tr>
				<td>家庭住址:</td>
				<td>
					<input class="easyui-validatebox" name="address">
				</td>
			</tr>
			<tr>
				<td>手机:</td>
				<td>
					<input class="easyui-validatebox" name="mobile">
				</td>
			</tr>
			<tr>
				<td>Email:</td>
				<td>
					<input class="easyui-validatebox" name="email">
				</td>
			</tr>
			<tr>
				<td>状态:</td>
				<td>
					<select id="status" name="status">
						<option value="0">在用</option>
						<option value="1">停用</option>
						<option value="3" selected="selected">全部</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td>
					<a href="#" class="easyui-linkbutton" icon="icon-query" onclick="$('#queryForm').submit()">查询</a>
				</td>
				<td>
					<a href="#" class="easyui-linkbutton" icon="icon-cancel" onclick="queryForm.reset();ajaxQuery();">重置</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="$('#queryWindow').window('close');">返回</a>
				</td>
			</tr>
		</table>
	</form>
</div>

<script type="text/javascript">
	
	$(document).ready(function(){

		$('#departid').combobox({
		    url: 'user.action?command=getDepts',
		    valueField: 'id',
		    textField: 'name'
		});
		
		$('#queryForm').form({
			onSubmit: function(){
				if($(this).form('validate')){
					ajaxQuery();
				}else{
					return false;
				}
			}
		});
	});
	
	function ajaxQuery(){
		var actionURL = "user.action?command=grid";
		var params = $("#queryForm").dataForAjax().json;
		
		$('#tt').datagrid({
		    url: actionURL,
		    queryParams: params
		});
	}
</script>